<?php
$this->headTitle('Chức năng','append');
?>
<div class="dashboard-menu dashboard-admin">
    <span class="back">&nbsp;</span>
    <h1>Chức năng</h1>

        <?php if($this->acl->checkAllowed(array('moduleName'=>'admin','controllerName'=>'newscat','actionName'=>'add'))){ ?>
            <a class="btn btn-danger" href="<?php echo $this->url(array('module'=>'admin', 'controller'=>'resource', 'action'=>'add'));?>">
                Thêm mới
            </a>
        <?php } ?>                        
</div>
<div class="row placeholders">
    <div class="col-md-12">
        <div class="widget-big">
            <div class="table table-responsive">
                <div class="search-result">
                    <table class="table table-bordetext-danger table-striped table-condensed table-hover" border="0" cellspacing="0" cellpadding="0">
                        <thead>
                            <tr class="warning">
                                <th style="width:10%;">ID</th>
                                <th style="width:25%;">Tên</th>
                                <th style="width:15%;">Module</th>
                                <th style="width:15%;">Controller</th>
                                <th style="width:15%;">Action</th>
                                <th style="width:10%;">STT</th>
                                <th style="width:10%;">Chức năng</th>                                
                            </tr>
                        </thead>
                        <tbody>
                        <?php
                            foreach ($this->resourceList as $resource){
                        ?>
                            <tr>
                                <td style="width:10%;" class="text-left"><?=$resource['resourceId'];?></td>
                                <td style="width:25%;" class="text-left"><?=$resource['resourceName'];?></td>
                                <td style="width:15%;" class="text-left"><?=strtoupper($resource['moduleName']);?></td>
                                <td style="width:15%;" class="text-left"><?=strtoupper($resource['controllerName']);?></td>
                                <td style="width:15%;" class="text-left"><?=strtoupper($resource['actionName']);?></td>
                                <td style="width:10%;" class="text-left"><?=$resource['ord'];?></td>                                                                                                                                                               
                                <td style="width:10%;" class="text-left">
                                <?php if($this->acl->checkAllowed(array('moduleName'=>'admin','controllerName'=>'newscat','actionName'=>'edit'))) ?>                                    
                                    <a class="glyphicon glyphicon-pencil" href="<?=$this->url(array('module'=>'admin', 'controller'=>'resource', 'action'=>'edit', 'resourceId'=>$resource['resourceId']))?>" title="Sửa thông tin chức năng"></a>
                                    &nbsp;&nbsp;                                    
                                <?php if($this->acl->checkAllowed(array('moduleName'=>'admin','controllerName'=>'newscat','actionName'=>'delete'))) ?>                                    
                                    <a class="glyphicon glyphicon-remove" href="<?=$this->url(array('module'=>'admin', 'controller'=>'resource', 'action'=>'delete', 'resourceId'=>$resource['resourceId']))?>" title="Xoá chức năng"></a>                                    
                                </td>
                            </tr>
                        <?php
                            } 
                        ?>
                        </tbody>
                    </table>
                </div>
            </div>
            <div class="clearfix"></div>
        </div>
    </div>
</div>